#include <irt_syscalls.h>

void _exit (int status) {
  __nacl_irt_exit (status);
#if defined(__x86_64__) || defined(__i386__)
  __asm__("hlt");
#else
  // For nacl_arm. sfi_constant_barrier is expanded to a bkpt instruction
  // which passes the validation.
  __asm__(".balign 16\n"
          "bkpt 0x5be0\n"
          ".balign 16");
#endif
  while (1);
}

weak_alias (_exit, _Exit)
weak_alias (_exit, exit)